import axios from '../axios'

/*
 * 机构管理模块
 */

// 保存
export const save = (data) => {
    return axios({
        url: '/department/saveDepartment',
        method: 'post',
        data
    })
}
// 编辑
export const edint = (data) => {
    return axios({
        url: '/department/updateDepartment',
        method: 'post',
        data
    })
}
// 删除
export const batchDelete = (params) => {
    return axios({
        url: '/department/deleteDepartment',
        method: 'get',
      params
    })
}
// 查询机构树
export const findDeptTree = () => {
    return axios({
        url: '/department/queryTreeDepartmentList',
        method: 'get'
    })
}
//查询类型树
export const findDeptType = (params) => {
  return axios({
    url: '/code/queryKVs?codeType=department_type',
    method: 'get',
    params
  })
}
//查询部门平级树
export const findDeptLevel = (params) => {
  return axios({
    url: '/department/queryDepartmentList',
    method: 'get',
    params
  })
}
